﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

using HZ.Supervise.Model.Enum;

public partial class Center_Control : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        string index = Request.QueryString["pageid"] == null ? "" : Request.QueryString["pageid"];
        PageRedirect(index);

    }
    /// <summary>
    /// 根据传入的参数判断跳转到哪个页面
    /// </summary>
    /// <param name="index"></param>
    private void PageRedirect(string index)
    { 
        PageInfo pageindex = (PageInfo)URLControl.GetPageInfo(index);
         
        if (ShowColumns.ShowColumn == null)
        {
            ShowColumns.ShowColumn = new ShowColumns();
        }
         
        ShowColumns.ShowColumn.GroupFields = pageindex.GroupField; 
         
        try
        { 
            if (!UserRuleCache.ValidatePageRight(pageindex.Title, HZ.Supervise.Model.Enum.OperateType.查看.ToString()))
            {
                HZ.Web.MessageBox.AlertAndRedirect("您没有足够的权限查看该页面，请与管理员联系", "../Admin/CurrentUserInfo.aspx");
                //CurrentAccount.Goto_NoPermission();
            }
            else
            {
                //设置菜单标志
                URLControl.SetMenuFlag(pageindex.Title);
                Response.Redirect(pageindex.URL);
            }
        }
        catch (Exception ee)
        {
            Response.Write("<script>alert('您没有足够的权限查看该页面，请与管理员联系');location.href('../Admin/CurrentUserInfo.aspx');</script>");
        } 
    } 
}




